package com.spice.service.util;

import cn.hutool.core.lang.hash.Hash;
import com.baomidou.mybatisplus.extension.service.IService;
import com.spice.service.entity.pojo.DocumentInfo;
import com.spice.service.entity.pojo.ShapeDesc;
import com.spice.service.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import static com.spice.common.constant.PermissionConstant.*;

import java.util.HashMap;

@Component
public class ServiceUtil {
    @Autowired
    public UserService userService;
    @Autowired
    public DocumentInfoService documentInfoService;
    @Autowired
    public ShapeDescService shapeDescService;
    @Autowired
    public NutritionContainService nutritionContainService;
    @Autowired
    public IngredientService ingredientService;
    @Autowired
    public SourceCheckSercive sourceCheckSercive;
    @Autowired
    public PackMaintainService packMaintainService;
    @Autowired
    public ProductMaintainService productMaintainService;
    @Autowired
    public FlowerChiliStudyService flowerChiliStudyService;
    @Autowired
    public ChiliStudyService chiliStudyService;

    public HashMap<String, IService<?>> getServiceMap() {
        HashMap<String, IService<?>> serviceMap = new HashMap<>();
        serviceMap.put(SHAPE_DESC, shapeDescService);
        serviceMap.put(NUTRITION_CONTAIN, nutritionContainService);
        serviceMap.put(INGREDIENT, ingredientService);
        serviceMap.put(SOURCE_CHECK, sourceCheckSercive);
        serviceMap.put(PACK_MAINTAIN, packMaintainService);
        serviceMap.put(PRODUCT_MAINTAIN, productMaintainService);
        serviceMap.put(FLOWER_CHILI_STUDY, flowerChiliStudyService);
        serviceMap.put(CHILI_STUDY, chiliStudyService);
        System.out.println(shapeDescService.list());

        return serviceMap;
    }


}
